package cn.wolfcode.crm.domain;

import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;
import java.util.HashMap;

@Getter
@Setter
public class CourseOrder {
    private Long id;
    //销售时间
    private Date inputTime;
    //客户
    private Customer customer;
    //课程名称
    private SystemDictionaryItem course;
    //课程价格
    private Long money;

    public String getJson(){
        HashMap<String,Object> map = new HashMap<>();
        map.put("id",id);
        map.put("inputTime",inputTime);
        if(customer != null){
            map.put("customer",customer);
        }
        if(course != null){
            map.put("course",course);
        }
        map.put("money",money);
        return JSON.toJSONString(map);
    }

}